﻿using System.Web.Mvc;
using SessionByActionFilter.DAL;

namespace SessionByActionFilter.Controllers
{
    public class BookController : Controller
    {

        #region With Transaction

        [NeedsPersistence]
        public ActionResult Index()
        {
            return View(DataAccessLayer.GetBooks());
        }

        #endregion

        #region Withouth Transaction

        //[NHibernateSession]
        //public ActionResult Index()
        //{
        //    return View(DataAccessLayerOpensTransaction.GetBooks());
        //}

        #endregion
    }
}
